﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="ProductInfo.aspx.cs" Inherits="EWDTAssignment.ProductInfo" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 318px;
        }
        .style2
        {
            font-size: large;
        }
        .style3
        {
            width: 348px;
        }
        #TextArea1
        {
            height: 76px;
            width: 441px;
        }
        .ratingStar
     {
         font-size: 0pt;
         width:15px;
         height:15px;
         margin:0px;
         padding:0px;
         cursor:pointer;
         display:block;
         background-repeat:no-repeat;
     }
     .fillStar
     {
         background-image: url(../images/star_full.png);
     }
     .noneStar
     {
         background-image: url(../images/star_none.png);
     }
     .halfStar
     {
         background-image:url(../images/star_half.png);
     }
     panel
     {
         margin:auto;
         width:70%;
     }
     
        .style4
        {
            width: 100%;
            color: #3333FF;
        }
        .style6
        {
            text-decoration: underline;
            color: #3333FF;
        }
        .style7
        {
            color: #3333FF;
        }
     
    </style>
  
    
    <script language="javascript" type="text/javascript">
// <![CDATA[

        function CommentArea_onclick() {

        }

// ]]>
    </script>
</asp:Content>
   
<asp:Content ID="Content3"  ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id ="center_content"> 
    <br />
    <br />
  
    <asp:DetailsView ID="dvProdInfo" runat="server" AutoGenerateRows="False" 
        DataSourceID="dsProduct" Height="152px" Width="550px" GridLines="None" 
            onpageindexchanging="dvProdInfo_PageIndexChanging" 
            ondatabound="dvProdInfo_DataBound" onitemcreated="dvProdInfo_ItemCreated">
        <Fields>
            <asp:TemplateField>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                 <asp:Label ID="lblProdName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                    <table style="width:83%; height: 188px; color: #3333FF;">
                        <tr>
                            <td class="style1">
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ProdImg") %>' 
                                    Height="144px" Width="170px" style="color: #FFFFFF" />
                                <br />
                                <asp:Label ID="lblProductID" runat="server" Text='<%# Eval("ProductID") %>' 
                                    Visible="False"></asp:Label>
                            </td>
                            <td class="style3">
                                <span class="style2">Price: $</span><asp:Label ID="lblPrice" runat="server" 
                                    Text='<%# Eval("Price") %>' CssClass="style2"></asp:Label>
                                <br class="style2" />
                                <span class="style2">Quantity: </span>
                                <asp:TextBox ID="txtBoxQty" runat="server" Height="23px" Width="38px" 
                                    CssClass="style2" Text="<%# 1 %>"></asp:TextBox>
                                <br class="style2" />
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ControlToValidate="txtBoxQty" ErrorMessage="Please enter number only" 
                                    ValidationExpression="\b[0-99]+(\.[0-99]+)?(e[+-]?[0-99]+)?\b" 
                                    style="color: #FF0000"></asp:RegularExpressionValidator>
                                <br />
                                <br />
                                <asp:ImageButton ID="imgBtnAddCart" runat="server" AlternateText="Add To Cart" 
                                    ImageUrl="~/images/btn_add_cart.gif" OnClick="imgBtnAddCart_Click" 
                                    Width="100px" />
                            </td>
                        
                        </tr>
                    </table>
                   
                </ItemTemplate>
            </asp:TemplateField>
        </Fields>
        <FooterTemplate>
          
          
          
          
          
          
          
          
          
          
          
            <table class="style4">
                <tr>
                    <td class="style7">
                        <span class="style6"><strong>Description</strong></span><br />
                        <asp:ListBox ID="ListBox1" runat="server" CssClass="style7" Height="80px" 
                            Width="250px"></asp:ListBox>
                        <span class="style7">
                        <br />
                        <br />
                        <br />
                        </span>
                    </td>
                    <td>
                        <asp:Label ID="lbldesc" runat="server" 
                            style="font-weight: 700; text-decoration: underline" 
                            Text="Product Specification"></asp:Label>
                        <br />
                        </span>
                        <asp:ListBox ID="listbxSpec" runat="server" CssClass="style7" Enabled="False" 
                            EnableTheming="False" EnableViewState="False" Height="80px" Width="250px">
                        </asp:ListBox>
                        <span class="style7">
                        <br />
                        <asp:Label ID="lblspec" runat="server" Text='<%# Eval("Specification") %>' 
                            Visible="False"></asp:Label>
                        <br />
                        <br />
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
          
          
          
          
          
          
          
          
          
          
          
        </FooterTemplate>
    </asp:DetailsView>

   

        <div style="height: 184px">
            <br />
            <br />
            <br />
    
    <asp:ObjectDataSource ID="dsProduct" runat="server" 
        OldValuesParameterFormatString="original_{0}" 
        SelectMethod="retrieveProductByID" 
            TypeName="EWDTAssignment.App_Code.DBManager" onselecting="dsProduct_Selecting">
        <SelectParameters>
            <asp:QueryStringParameter Name="pID" QueryStringField="ProductID" 
                Type="Int32" />
        </SelectParameters>
</asp:ObjectDataSource>
        
            <asp:Table ID ="table" runat ="server" Height="58px" Width="393px" >
                                <asp:TableRow ID ="TableRow" runat="server">
                                    <asp:TableCell ID ="TableCell1" runat="server">
                                        <asp:label ID = "comment" runat="server" CssClass ="label">Comments</ASP:label>
                                    </asp:TableCell> 
                                    <asp:TableCell ID ="TableCell2" runat="server" height = "20">
                                        <asp:Label ID = "rating" runat="server">Ratings</asp:Label>
                                        <asp:Rating ID= "Rating1" runat="server" CurrentRating="0" 
                                                        MaxRating="5"
                                                        StarCssClass="ratingStar" EmptyStarCssClass="noneStar" FilledStarCssClass="fillStar" WaitingStarCssClass="noneStar" AutoPostBack="true" ><%--OnChanged="Rating1_Changed"> --%>
                                        </asp:Rating>
                                    </asp:TableCell>
                                </asp:TableRow>
                                <asp:TableRow>
                                        <asp:TableCell>
                                        <asp:Label ID="Label1" runat="server" Text="NickName:"></asp:Label>
                                        </asp:TableCell>
                                        <asp:TableCell>
                                        <asp:TextBox ID="txtbxNickName" runat="server"></asp:TextBox>
                                        </asp:TableCell>
                                </asp:TableRow>
                            </asp:Table>
            <br />
            <br />
            
            <br />
            <asp:TextBox ID="TextBox2" runat="server" Height="86px" Width="283px"></asp:TextBox>
            <br />
            <br />
            <br />
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <br />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                onclick="btnSubmit_Click" />
                    <asp:Label ID="lblSuccess" runat="server" Text="Success" Visible="False"></asp:Label>
                    <asp:Repeater ID="repeat" runat="server" DataSourceID="dsComment">
                        <ItemTemplate>
                            <asp:Panel ID = "panel" runat="server" BorderStyle="Solid" BorderWidth="1" Width="500" Height = "50">
                            <table border="0" >
                                <tr>
                                    <td>
                                        <asp:Label ID="commentID" runat="server" Width="30%" Text='<%# Bind("NickName") %>'/>
                                    </td>
                                    <td><asp:HiddenField ID="HiddenField1" runat="server" /></td>
                                    <td>
                                        <asp:Rating ID="Rating2" runat="server" CurrentRating='<%#Bind("Rating") %>' 
                                            EmptyStarCssClass="noneStar" FilledStarCssClass="fillStar" MaxRating="5" 
                                            ReadOnly="true" StarCssClass="ratingStar" WaitingStarCssClass="noneStar" />
                                    </td>
                                </tr>
                                <tr>
                                    
                                </tr>
                                <tr>
                                    <td colspan = "3">
                                        <asp:Label ID="ReviewIDLabel" runat="server" Text='<%# Bind("Review") %>' />
                                    </td>
                                </tr>
                                
                            </table>
                            </asp:Panel>
                            <br />
                            
                        </ItemTemplate>
                    </asp:Repeater>
                </ContentTemplate>
            </asp:UpdatePanel>
            
            <asp:ObjectDataSource ID="dsComment" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="displayComments1" 
                TypeName="EWDTAssignment.App_Code.DBManager">
                <SelectParameters>
                    <asp:QueryStringParameter Name="productId" QueryStringField="productID" 
                        Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <br />
        </div>

   

    <br />
    

    <br />
   
        <br />
   
    <br />
    
<br />

</div>
</asp:Content>





